package com.ziyucoding.springboot.labs.redislike.controller;

import com.ziyucoding.springboot.labs.redislike.common.CommonResponse;
import com.ziyucoding.springboot.labs.redislike.service.LikeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 用户点赞控制器
 *
 * @author ziyucoding
 * @date 2023-02-07
 **/
@RestController
@RequestMapping("/user-like/")
public class LikeController {

    @Autowired
    private LikeService likeService;

    @PostMapping("like")
    public CommonResponse<Object> likeInfo(String infoId, String userId) {
        return likeService.likeInfo(infoId, userId);
    }

    @PostMapping("dislike")
    public CommonResponse<Object> dislikeInfo(String infoId, String userId) {
        return likeService.dislikeInfo(infoId, userId);
    }

}
